﻿using Qlab.Infrastructure.Data;
using Qlab.SharedKernel.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Qlab.Infrastructure
{
    public static class StartupSetup
    {
        public static void AddDbContext(this IServiceCollection services)
        {
            string connectionString = ConfigExtension.Configuration.GetConnectionString("SqliteConnection");
            services.AddDbContext<AppDbContext>(options => options.UseSqlite(connectionString)); // will be created in web project root
        }
    }
}